import requests

# url='http://fy.iciba.com/ajax.php?a=fy'
#
# headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36'}
#
# data2={
#   'f': 'auto',
#   't': 'auto',
#   'w': '好好学习'
# }
#
# r=requests.post(url,headers=headers,data=data2)
# print(r.content)


url='http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule'


headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36'}

data2={
    'i': '好好学习',
    'from':'AUTO',
    'to': 'AUTO',
    'smartresult': 'dict',
    'client': 'fanyideskweb',
    'salt': '16062740908141',
    'sign': 'c9c8f0a0cf517739d62558e29b37186c',
    'lts': '1606274090814',
    'bv': '02edb5d6c6ac4286cd4393133e5aab14',
    'doctype': 'json',
    'version': '2.1',
    'keyfrom': 'fanyi.web',
    'action': 'FY_BY_REALTlME'
}

r=requests.post(url,headers=headers,data=data2)
print(r.content)
